import cv2
from matplotlib import pyplot as plt
import matplotlib
import baseconf

matplotlib.use('TkAgg')

fristvideo_path = baseconf.BASE_DISK+":/datasets_path/tianchivit/fristvideo"

cap = cv2.VideoCapture(fristvideo_path+'./43.avi')
for _ in range(30):
    cap.read()
img = cap.read()[1]
image = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# image = Image.fromarray(image)
#
# # Load a model
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Initiate ORB detector
orb = cv2.ORB_create()
# find the keypoints with ORB
kp = orb.detect(image,None)
# compute the descriptors with ORB
kp, des = orb.compute(image, kp)
# draw only keypoints location,not size and orientation
img2 = cv2.drawKeypoints(image, kp, None, color=(0,255,0), flags=0)
plt.imshow(img2)
plt.show()
while(1):
    pass

